package pl.pawluk.inz.entities;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * Created with IntelliJ IDEA.
 * User: mandp
 * Date: 17.05.13
 * Time: 19:39
 * To change this template use File | Settings | File Templates.
 */
@javax.persistence.Table(name = "lecture", schema = "public", catalog = "")
@Entity
public class LectureEntity {
    private Long id;

    @javax.persistence.Column(name = "id", nullable = false, insertable = true, updatable = true, length = 19, precision = 0)
    @Id
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    private String name;

    @javax.persistence.Column(name = "name", nullable = false, insertable = true, updatable = true, length = 128, precision = 0)
    @Basic
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private Long subjectId;

    @javax.persistence.Column(name = "subject_id", nullable = false, insertable = true, updatable = true, length = 19, precision = 0)
    @Basic
    public Long getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(Long subjectId) {
        this.subjectId = subjectId;
    }

    private Long instructorId;

    @javax.persistence.Column(name = "instructor_id", nullable = false, insertable = true, updatable = true, length = 19, precision = 0)
    @Basic
    public Long getInstructorId() {
        return instructorId;
    }

    public void setInstructorId(Long instructorId) {
        this.instructorId = instructorId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        LectureEntity that = (LectureEntity) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (instructorId != null ? !instructorId.equals(that.instructorId) : that.instructorId != null) return false;
        if (name != null ? !name.equals(that.name) : that.name != null) return false;
        if (subjectId != null ? !subjectId.equals(that.subjectId) : that.subjectId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (subjectId != null ? subjectId.hashCode() : 0);
        result = 31 * result + (instructorId != null ? instructorId.hashCode() : 0);
        return result;
    }
}
